import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;


public class GeneradorCasos2 {
	
	private String FILENAME = "Tp2Ej2.in";
	private int CANTCASOS = 1000;
	
	public void generarCasos() throws Exception{
		BufferedWriter bw = new BufferedWriter(new FileWriter(new File(FILENAME)));
		
		int cantDeVallas = 0;
		for (int i = 0; i < CANTCASOS; i++) {
			cantDeVallas++;
			
			int marea = (int)Math.ceil((Math.random() * 10));;
			
			bw.append(marea + " " + ( cantDeVallas ));
			bw.newLine();
			
			for (int j = 0; j < cantDeVallas ; j++) {
				int largo = 		((int)Math.ceil((Math.random() * i))) % cantDeVallas;
				int alto = 			(int)Math.ceil((Math.random() * 10));
				int x = 			((int)Math.ceil((Math.random() * i))) % cantDeVallas;
				int y = 			((int)Math.ceil((Math.random() * i))) % cantDeVallas;
				
				int direccion = 	((int)Math.ceil((Math.random() * 10))) % 2;
				
				String orientacion = "|";
				
				if( direccion == 0 ){
					orientacion = "-";
				}
				
				bw.append(x + " " + y + " " + orientacion + " "  + largo + " " + alto);
				bw.newLine();
			}
		}
		
		bw.append("-1 -1");
		bw.close();
	}

	public static void main(String[] args) {
		GeneradorCasos2 g = new GeneradorCasos2();
		try {
			g.generarCasos();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
